<#assign mapperPackageName = "red.mlz.module.module.tag.mapper">
<#assign mapperName = entity + "Mapper">
<#assign serviceName = entity + "Service">
<#assign mapperNameVar = mapperName?uncap_first>
package ${package.Service};
package ${package.Service};

import ${package.Entity}.${entity};
import ${mapperPackageName}.${mapperName};
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ${serviceName} {

@Autowired
private ${mapperName} ${mapperNameVar};

public ${entity} getById(Long ${table.name}Id) {

return ${mapperNameVar}.getById(${table.name}Id);
}

public ${entity} extractById(Long ${table.name}Id) {

return ${mapperNameVar}.extractById(${table.name}Id);
}

public Integer insert(${entity} entity) {

return ${mapperNameVar}.insert(entity);
}

public Integer update(${entity} entity) {

return ${mapperNameVar}.update(entity);
}

public Integer delete(Long id, Integer updateTime) {

return ${mapperNameVar}.delete(updateTime, id);
}
}